<template>
    <el-row>
        <el-col :span="24">
            <el-table :data="mrdiseaseList" style="width: 100%">
        <el-table-column label="ICD编码" prop="disease.diseaseICD" />
                <el-table-column label="疾病名称" prop="disease.diseaseName" />
                <el-table-column align="right">
                <template #header>
                    <el-button size="small" @click="dialogVisible=true">
                    增加
                    </el-button>
                </template>
                <template #default="scope">
                    <el-button
                        size="small"
                        type="danger"
                        @click="handleDelete(scope.$index, scope.row)"
                    >
                        删除
                    </el-button>
                </template>
                </el-table-column>
            </el-table>
        </el-col>
    </el-row>

    <el-dialog v-model="dialogVisible" title="添加药品" width="500" draggable>
        <el-row>
            <el-col :span="8">
                <el-input v-model="drugQuery.drugName" placeholder="请输入名称搜索"/>
            </el-col>
            <el-col :span="3">
                <el-button @click="searchDrug">搜索</el-button>
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="24">
                <el-table :data="dieaseList" stripe style="width: 100%" 
                @selection-change="handleSelectionChange">
                    <el-table-column type="selection"  width="55" />
                    <el-table-column prop="diseaseICD" label="ICD编码"  />
                    <el-table-column prop="drugName" label="药品名称"  />
                    <el-table-column prop="drugFormat" label="药品规格"  />
                    <el-table-column prop="drugUnit" label="包装单位"  />
                    <el-table-column prop="drugPrice" label="药品单价"  />
                    <el-table-column prop="drugDosage" label="药剂类型"  />
                    <el-table-column prop="manufacturer" label="生产厂家"  />
                </el-table>
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="24">
                <el-button @click="addMrDisease">保存</el-button>
            </el-col>
        </el-row> 

    </el-dialog>
</template>

<script setup>
import httpRequest from '@/common';
import { ElMessage } from 'element-plus';
import {ref,getCurrentInstance, onMounted,defineProps, watch} from 'vue';

const {proxy} = getCurrentInstance();

//获取父组件传递的registerId  挂号id
const props = defineProps({
    rid:{
        type: Number,
        required: true
    }
});



</script>

<style>
</style>